Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 20 Dec 2002 11:49:37 -0800
From:      Kurt Bigler <kkb@breathhost.net>
To:        Fernando Gleiser <fgleiser@cactus.fi.uba.ar>, <freebsd-questions@freebsd.org>
Subject:   Re: chown  broken??
Message-ID:  <BA28B451.56C2%kkb@breathhost.net>
In-Reply-To: <20021220123728.S52840-100000@cactus.fi.uba.ar>

next in thread | previous in thread | raw e-mail | index | archive | help
on 12/20/02 7:39 AM, Fernando Gleiser <fgleiser@cactus.fi.uba.ar> wrote:

> On Fri, 20 Dec 2002, Roman Neuhauser wrote:
> 
>> apart from what others said about wildcard substitution:
>> 
>> roman@freepuppy /usr 1005:1 > ls -l .*
>> zsh: no matches found: .*
>> roman@freepuppy /usr 1006:1 >
>> 
>> IOW, the behavior is actually shell- (and shell configuration-)
>> dependent.
> 
> Yes, because wildcard expansion is done by the shell.
> 
>> zsh (at least with my settings) would protect you from
>> yourself in this situation.
> 
> And will prevent you from doing it when you really need it :)

I don't know zsh, but if it has a setting that prevents wildcard expansion
from including .. as a match for .* that strikes me as an all-around good
thing.

When do you _really_need_ .* to match .. ?  You could in such a situation
type .. explicitly, just as you would often add .* when * does not work.

One possible approach with some nice "consistency" would be:

    *       matches:    foo     but not     .foo
    .*      matches:    .foo    but not     ..foo (and not ..)

Of course to remain fully consistent with this approach (by one
interpretation), foo* would not match foo.foo - rather you would have to
type foo.* or foo*.* according to your needs.  This might fail to meet
expectatons in more situations than the ones it fixes.

That aside, even an interpretation of .* that allows ..fo but simply
disallows only .. still strikes me as an all-around good thing.  Anyone hurt
by this (at least on the command line) can simply add .. explicitly to the
list.  Maybe it would be an improvement to unix if this change were made to
all shells, or even just to go into prompt for "y" mode when hitting ".." in
this one case (if the shell is interactive).

  Kurt Bigler

> 
> 
> Fer
> 
>> 
>> --
>> If you cc me or remove the list(s) completely I'll most likely ignore
>> your message.    see http://www.eyrie.org./~eagle/faqs/questions.html
>> 
>> To Unsubscribe: send mail to majordomo@FreeBSD.org
>> with "unsubscribe freebsd-questions" in the body of the message
>> 
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-questions" in the body of the message
> 


To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?BA28B451.56C2%kkb>